import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '工业区代码',
    align:"center",
    dataIndex: 'grqCode'
   },
   {
    title: '工业区名称',
    align:"center",
    dataIndex: 'grqName'
   },
   {
    title: '类型',
    align:"center",
    dataIndex: 'grlx'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "工业区代码",
      field: 'grqCode',
      component: 'JInput',
      colProps: {span: 6},
 	},
	{
      label: "工业区名称",
      field: 'grqName',
      component: 'JInput',
      colProps: {span: 6},
 	},
	{
      label: "类型",
      field: 'grlx',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'industry_type',
    },
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '工业区代码',
    field: 'grqCode',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入工业区代码!'},
          ];
     },
  },
  {
    label: '工业区名称',
    field: 'grqName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入工业区名称!'},
          ];
     },
  },
  {
    label: '类型',
    field: 'grlx',
    component: 'Select',
    componentProps: {
      options:[{label:"工业区",value:"工业区"},{label:"村委会",value:"村委会"}]
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
